﻿using FFIV.Lib.Controlers.Admin;
using FFIV.Lib.Utilities;
using FFIV.Lib.WebExtension;

public partial class Admin_AddArticle : FFWebPageBase
{
	private AddArticleController m_Controller;

	protected override void InitialFileds()
	{
		m_Controller = new AddArticleController(uc_AddArticle);
	}

	protected override void BindingEvents()
	{
		uc_AddArticle.AddArticle += uc_AddArticle_AddArticle;
		uc_AddArticle.AddDraft += uc_AddArticle_AddDraft;
	}

	public override void ShowMessage()
	{
		if (!IsPostBack)
		{
			m_Controller.LoadPage();
		}
	}

	public override Permissions RequiredPermission
	{
		get { return Permissions.Author; }
	}


	private void uc_AddArticle_AddArticle(object sender, System.EventArgs e)
	{
		m_Controller.AddArticle();
	}

	private void uc_AddArticle_AddDraft(object sender, System.EventArgs e)
	{
		m_Controller.AddDraft();
	}
}
